{extend name="layout" /} {block name="main"}
<div class="wrapper wrapper-content animated fadeInRight">
	<div class="row">
		<div class="col-sm-10">
			<div class="ibox float-e-margins" style="height: 900px;">
				<div class="ibox-title">
					<h5></h5>
					<div class="ibox-tools">
						<a class="collapse-link">
							<i class="fa fa-chevron-up"></i>
						</a>
					</div>
				</div>
				<div class="ibox-content">
						<header class="panel-heading">QQ登录</header>
					<form class="form-horizontal m-t" name="post-form" id="commentForm" method="post" action="">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">账户</label>
                            <div class="col-sm-8">
                                <input  name="qq_appid" id="qq_appid" minlength="6" maxlength="32" type="text" class="form-control" required="" aria-required="true" value="{$info.qq_appid.value}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">安全码</label>
                            <div class="col-sm-8">
                                <input  name="qq_appkey" id="qq_appkey" type="text" class="form-control" minlength="1" maxlength="32" required="" aria-required="true" value="{$info.qq_appkey.value}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">回调地址</label>
                            <div class="col-sm-8">
                                <input  name="qq_back" id="qq_back" type="text" class="form-control" minlength="1" maxlength="32" required="" aria-required="true" value="{$info.qq_back.value}">
                            </div>
                        </div>
                        <hr> 
                         <header class="panel-heading">微信登录</header>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">账户</label>
                            <div class="col-sm-8">
                                <input  name="wechat_appid" id="wechat_appid" minlength="6" maxlength="32" type="text" class="form-control" required="" aria-required="true" value="{$info.wechat_appid.value}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">安全码</label>
                            <div class="col-sm-8">
                                <input  name="wechat_appsecret" id="wechat_appsecret" type="text" class="form-control" minlength="1" maxlength="32" required="" aria-required="true" value="{$info.wechat_appsecret.value}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">回调地址</label>
                            <div class="col-sm-8">
                                <input  name="wechat_back" id="wechat_back" type="text" class="form-control" minlength="1" maxlength="32" required="" aria-required="true" value="{$info.wechat_back.value}">
                            </div>
                        </div>
                        <hr>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button class="btn btn-primary" target-form="post-form" type="submit" onclick="save()">提交</button>
                                <button class="btn btn-danger" target-form="post-form" type="submit" onclick="return();">返回</button>
                            </div>
                        </div>
                    </form>
				</div>
			</div>
		</div>
	</div>
</div>

<script type="text/javascript">
	/**
	 * AJAX提交表单
	 * @author 陈一中
	 * @return {[type]} [description]
	 */
	function save() {
		var radio = $("#radio").val();
		$.ajax({
			url: "/admin/Basic/update_basic.html",
			type: 'post',
			dataType: 'json',
			data: {
				name: name
			},
			success: function(res) {
				if(res.status == true) {
					layer.msg(res.info);
					setTimeout(function() {
						window.location.href = "/Basic/index.html";
					}, 1000);
				} else {
					layer.msg(res.info);
				}
			},
			error: function() {
				layer.alert('服务器繁忙，稍后再试', {
					icon: 5
				});
			}
		})
	}

	/**
	 * 添加位置JS代码
	 * @param  
	 * @author 陈一中
	 */
	$("#addposition").click(function() {
		$("#modal").css("display", "block");
	});
	$("#close").click(function() {
		$("#modal").css("display", "none");
	})
</script>
{/block}